import request from "@/utils/request";

// console.log(window.globalConfig);

const service = 'https://restapi.amap.com/v3'
// const service = (window.globalConfig.AMAP_URL || '') + '/amap'
// const service = window.globalConfig.AMAP_URL
// window.globalConfig.AMAP_URL
const key = 'a121740bf9109b7b41df37ea8b10727e'

// 逆地理编码 经纬度=》地址
export function regeo(data) {
  return fetch(service + `/geocode/regeo?key=${key}&location=${data.location}`,
  {
    method:'get'
  }
    // params: {
    //   key,
    //   ...data
    // },
).then(async res=> res.json())
// .then(async res=>{
//   console.log(res,res.data);
//   return res.data})
  // return request({
  //   url: service + "/geocode/regeo",
  //   params: {
  //     key,
  //     ...data
  //   },
  // });
}

